<?php session_start();
	include('../controller/functions.php');
	User::connection();

$userArr	= array('teacher');
	if(!in_array($_SESSION['user'],$userArr)) {
	User::validSession();

}
$user_id = $_SESSION['curuser'];
if ($_GET['q'] == 'logout') 
{
	User::user_logout();
		print '		
			<script type="text/javascript">		
			window.location = "../login_r.php";
			</script>
			';

}

$sec = $_GET['sec'];

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="../images/fav.ico">
<link rel="icon" type="image/gif" href="../images/fav.ico">
<title>View Class</title>

	<link rel="stylesheet" href="../css/style2.css" type="text/css" charset="utf-8" />
    <link rel="stylesheet" href="../css/front.css" type="text/css" charset="utf-8" />
    	<link type="text/css" href="../css/demo.css" rel="stylesheet" />
           <link rel="stylesheet" href="../css/general.css" type="text/css" charset="utf-8" />
</head>
<body>

 <div id="page">
<div id="wrapper">
        		 
        		   <div class="header_top" id="header_top"> </div>
  </div>
  <div class="header2"></div> 
	<div class="header"><!--open logo -->
		  </div><!--end header -->
	<!-- close logo-->
<!-- hide the client inquiries php-->
    <?php
    echo '<div id="nav">';
    echo '<div class="underlinemenu">';
	include('menu_view.php');
	echo '</div>';
    echo '</div>';
	?>
    <div id="header_in"> <!--open header -->
   <p> </p>
    
    <table width="100%" height="56">
     <tr>
       <td width="317" align="left" class="date"> 
        <? User::oras(); ?>
        </td>
            
       <td width="388" align="right"><? User::showPic(); ?></td>
       <td width="279">&nbsp;&nbsp;<? User::showUser(); ?>        </td>
       </tr>
   </table>
     
  
    </div>
    <div id="ex">
    </div>
    
      <p> </p>
       <div id="body"> <!--open body -->
    
	 <div id="sidebar"> 
        <!--<div id="chef_ind"> open chef -->
        <div id="welcome"> <!--open welcome -->
           <!-- <h2 class="guilded"></h2> -->
        </div> <!--close welcome-->

<? echo '<p class="more">';
echo '';
 
   require('sideBar.php');
    
echo'</p>';
?>

        </div>
        
   <!--   </div>close left -->
      
    <div id="content"> 
      <div class="desriptionHeader"> <!--open right-->
      <div id="container">
    
         <div class="post3_students"><h2>Class Schedule</h2> </div>
      
            <div class="desriptionHeader"> <!--open right-->
       <div class="postbg1"><!--open booking -->
        <?
		
		$queryHome = "SELECT * FROM tbluser u INNER JOIN tblsection s ON u.userid = s.sectionAdviser 
		INNER JOIN tblclass c  ON c.sectionName = s.sectionName  WHERE s.sectionid = '$sec';
";


			print '
	<table width="680" align="center" bordercolor="#000000" " bgcolor="#ebf9b4" >
	<tr>
		<td align="left" colspan="6"><b>Subjects</b></td>
    </tr>
        <tr>
			<td class="label" align="center"><strong>Filipino</strong></td>
            <td class="label" align="center"><strong>English</strong></td>
			<td class="label" align="center"><strong>Math</strong></td>
			<td class="label" align="center"><strong>Science</strong></td>
            <td class="label" align="center"><strong>Makabayan</strong></td>
			 <td class="label" align="center"><strong>Makabayan1</strong></td>
			  <td class="label" align="center"><strong>Makabayan2</strong></td>
			   <td class="label" align="center"><strong>Makabayan3</strong></td>
			    <td class="label" align="center"><strong>Makabayan4</strong></td>
	
	';
		
		
		$que = mysql_query($queryHome);
	
		
		$queryRow = mysql_fetch_assoc($que);
		$sn = $queryRow['sectionid'];
		$f = $queryRow['filipino'];
		$e = $queryRow['english'];
		$m = $queryRow['math'];
		$s = $queryRow['science'];
		$mk = $queryRow['makabayan'];
		$mk1 = $queryRow['makabayan1'];
		$mk2 = $queryRow['makabayan2'];
		$mk3 = $queryRow['makabayan3'];
		$mk4 = $queryRow['makabayan4'];
		
		
		//filipino
		$ff = "SELECT fname,mname,lname FROM tbluser u WHERE u.userid = $f";
		$qf = mysql_query($ff);
		$rf = mysql_fetch_assoc($qf);
		
		$fname = $rf['fname'] .", ". $rf['mname'] ." ". $rf['lname'];
		
		
		//english
		$qe = mysql_query("SELECT fname,mname,lname FROM tbluser u WHERE u.userid = $e");
		$re = mysql_fetch_assoc($qe);
		
		$ename = $re['fname'] .", ". $re['mname'] ." ". $re['lname'];
		
		//math
		$qm = mysql_query("SELECT fname,mname,lname FROM tbluser u WHERE u.userid = $m");
		$rm = mysql_fetch_assoc($qm);
		
		$mname = $rm['fname'] .", ". $rm['mname'] ." ". $rm['lname'];
		
		
		//science
		$qs = mysql_query("SELECT fname,mname,lname FROM tbluser u WHERE u.userid = $s");
		$rs = mysql_fetch_assoc($qs);
		
		$sname = $rs['fname'] .", ". $rs['mname'] ." ". $rs['lname'];
	
		//makabayan
		$qmk = mysql_query("SELECT fname,mname,lname FROM tbluser u WHERE u.userid = $mk");
		$rmk = mysql_fetch_assoc($qmk);
		
		$mkname = $rmk['fname'] .", ". $rmk['mname'] ." ". $rmk['lname'];
		
		
		//makabayan1
		$qmk1 = mysql_query("SELECT fname,mname,lname FROM tbluser u WHERE u.userid = $mk1");
		$rmk1 = mysql_fetch_assoc($qmk1);
		
		$mk1name = $rmk1['fname'] .", ". $rmk1['mname'] ." ". $rmk1['lname'];
		
		//makabayan2
		$qmk2 = mysql_query("SELECT fname,mname,lname FROM tbluser u WHERE u.userid = $mk2");
		$rmk2 = mysql_fetch_assoc($qmk2);
		
		$mk2name = $rmk2['fname'] .", ". $rmk2['mname'] ." ". $rmk2['lname'];
		
	//makabayan3
		$qmk3 = mysql_query("SELECT fname,mname,lname FROM tbluser u WHERE u.userid = $mk3");
		$rmk3 = mysql_fetch_assoc($qmk3);
		
		$mk3name = $rmk3['fname'] .", ". $rmk3['mname'] ." ". $rmk3['lname'];

	//makabayan4
		$qmk4 = mysql_query("SELECT fname,mname,lname FROM tbluser u WHERE u.userid = $mk4");
		$rmk4 = mysql_fetch_assoc($qmk4);
		
		$mk4name = $rmk4['fname'] .", ". $rmk4['mname'] ." ". $rmk4['lname'];
		
	$a++;
		if ($a%2==1)
		{ 
		echo "<tr bgcolor='#e6e4b1'>";
		}
		else
		{
			echo "<tr bgcolor='#c9e362'>";	
		}
		print '<br />';
	
		print '<h2> SECTION: '.$queryRow['sectionName'].'</h2>';
		print '<br />';
		
		print ' 
						<td align="center" class="extra"><a href="viewUser1.php?name='.$f.'&s='.$sn.'">'.$fname.'</a></td>
						<td align="center" class="extra"><a href="viewUser1.php?name='.$e.'&s='.$sn.'">'.$ename.'</a></td>
						<td align="center" class="extra"><a href="viewUser1.php?name='.$m.'&s='.$sn.'">'.$mname.'</a></td>
						<td align="center" class="extra"><a href="viewUser1.php?name='.$s.'&s='.$sn.'">'.$sname.'</a></td>
						<td align="center" class="extra"><a href="viewUser1.php?name='.$mk.'&s='.$sn.'">'.$mkname.'</a></td>
						<td align="center" class="extra"><a href="viewUser1.php?name='.$mk1.'&s='.$sn.'">'.$mk1name.'</a></td>
						<td align="center" class="extra"><a href="viewUser1.php?name='.$mk2.'&s='.$sn.'">'.$mk2name.'</a></td>
						<td align="center" class="extra"><a href="viewUser1.php?name='.$mk3.'&s='.$sn.'">'.$mk3name.'</a></td>
						<td align="center" class="extra"><a href="viewUser1.php?name='.$mk4.'&s='.$sn.'">'.$mk4name.'</a></td>
						</table>
					
						';	
		
		
		
		
		 ?>
                 <?
		
		$queryHome1 = "SELECT * FROM tbluser u INNER JOIN tblsection s ON u.userid = s.sectionAdviser 
		INNER JOIN tblclass c  ON c.sectionName = s.sectionName  WHERE s.sectionid = '$sec';
";


			print '
	<table width="680" align="center" bordercolor="#000000" " bgcolor="#ebf9b4" >
	<tr>
		<td align="left" colspan="6"><b>Time</b></td>
    </tr>
        <tr>
			<td class="label" align="center"><strong>Filipino</strong></td>
            <td class="label" align="center"><strong>English</strong></td>
			<td class="label" align="center"><strong>Math</strong></td>
			<td class="label" align="center"><strong>Science</strong></td>
            <td class="label" align="center"><strong>Makabayan</strong></td>
			 <td class="label" align="center"><strong>Makabayan1</strong></td>
			  <td class="label" align="center"><strong>Makabayan2</strong></td>
			   <td class="label" align="center"><strong>Makabayan3</strong></td>
			    <td class="label" align="center"><strong>Makabayan4</strong></td>
	
	';
		
		
		$que1 = mysql_query($queryHome1);
	
		
		$queryRow1 = mysql_fetch_assoc($que1);
		$sn = $queryRow1['sectionid'];
		$f1 = $queryRow1['filiOras'];
		$e1 = $queryRow1['englOras'];
		$m1 = $queryRow1['mathOras'];
		$s1 = $queryRow1['scieOras'];
		$mk1 = $queryRow1['makaOras'];
		$mk11 = $queryRow1['maka1Oras'];
		$mk21 = $queryRow1['maka2Oras'];
		$mk31 = $queryRow1['maka3Oras'];
		$mk41 = $queryRow1['maka4Oras'];
		
		$f12 = $queryRow1['filiOras1'];
		$e12 = $queryRow1['englOras1'];
		$m12 = $queryRow1['mathOras1'];
		$s12 = $queryRow1['scieOras1'];
		$mk12 = $queryRow1['makaOras1'];
		$mk112 = $queryRow1['maka1Oras1'];
		$mk212 = $queryRow1['maka2Oras1'];
		$mk312 = $queryRow1['maka3Oras1'];
		$mk412 = $queryRow1['maka4Oras1'];
		
	
	$a++;
		if ($a%2==1)
		{ 
		echo "<tr bgcolor='#e6e4b1'>";
		}
		else
		{
			echo "<tr bgcolor='#c9e362'>";	
		}
		print '<br />';
		
	
		print '<br />';
		print '
						<td align="center" class="extra">'.$f12.'</td>
						<td align="center" class="extra">'.$e12.'</td>
						<td align="center" class="extra">'.$m12.'</td>
						<td align="center" class="extra">'.$s12.'</td>
						<td align="center" class="extra">'.$mk12.'</td>
						<td align="center" class="extra">'.$mk112.'</td>
						<td align="center" class="extra">'.$mk212.'</td>
						<td align="center" class="extra">'.$mk312.'</td>
						<td align="center" class="extra">'.$mk412.'</td>
						
						<tr>
						
						<td align="center" class="extra">'.$f1.'</td>
						<td align="center" class="extra">'.$e1.'</td>
						<td align="center" class="extra">'.$m1.'</td>
						<td align="center" class="extra">'.$s1.'</td>
						<td align="center" class="extra">'.$mk1.'</td>
						<td align="center" class="extra">'.$mk11.'</td>
						<td align="center" class="extra">'.$mk21.'</td>
						<td align="center" class="extra">'.$mk31.'</td>
						<td align="center" class="extra">'.$mk41.'</td>
						</tr>
						</table>
					
						';	
		
		
		
		
		 ?>
       
	    </div><!--close desc -->
   
        
         </div> <!--close container-->
   			
	  </div><!--close booking -->
   </div><!--close desc -->
    	</div> <!--close right-->
     
      <div class="clear">&nbsp;</div>
 <!-- footer-->
 <?php 
	  echo '<div id="footer">';
     include('footer_view.php');
      echo '</div>';	
	  ?>

    </div><!-- close body-->
</div><!-- close page-->


</body>
</html>

